<?php

declare(strict_types=1);

namespace App\CustHub\Request;

use Mine\MineFormRequest;

class KeywordTagRequest extends MineFormRequest
{
    public function saveRules()
    {
        return [
            'name' => 'required',
            'corp_id' => 'required',
//            'cfg' => 'required'
//            'trigger_obj' => 'required|in:0,1',
//            'trigger_type' => 'required|in:0,1',
//            'match_type' => 'in:0,1',
//            'keywords' => 'required',
//            'corp_tag_ids' => 'required_without_all:smart_tag_ids',
//            'smart_tag_ids' => 'required_without_all:corp_tag_ids'
        ];
    }

    public function updateRules()
    {
        $updateRule = [
            'id' => 'required'
        ];

        return array_merge($this->saveRules(), $updateRule);
    }

    public function deleteRules()
    {
        return [
            'id' => 'required'
        ];
    }

    public function messages(): array
    {
        return [
            'corp_tag_ids.required_without_all' => '请选择标签',
            'smart_tag_ids.required_without_all' => '请选择标签',
        ];
    }
}